<?php
namespace app\admin\controller;

class About extends Comm{
	//社区列表
	public function fazhan(){
		//面包屑标签显示
		$controller = request()->controller();
		$action = request()->action();
		$controller = model('Role')->where(['controller'=>$controller])->find()->rname;
		$action = model('Role')->where(['action'=>$action])->find()->rname;
		$this->assign('controller',$controller);
		$this->assign('action',$action);

		foreach(model('fazhan')->select() as $val){
			$data[] = $val->toArray();
		}
		$this->assign('data',$data);
		return $this->fetch();
	}

	//发展添加
	public function fazhan_add(){
		return $this->fetch();
	}

	//处理添加
	public function fazhan_doadd(){
		$res = model('Fazhan')->allowfield(true)->save($_POST);
		if($res > 0){
			$this->success('成功');
		}
	}

	//处理删除
	public function do_del(){
		$res = model('Fazhan')->where(['id'=>$_POST['id']])->delete();
		if($res > 0){
			$this->success($_POST['id']);
		}
	}
	
}